package com.online.service.impl;

import com.online.entity.MultiQuestion;
import com.online.mapper.MultiQuestionMapper;
import com.online.service.MultiQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MultiQuestionServiceImpl implements MultiQuestionService {
    @Autowired
    private MultiQuestionMapper multiQuestionMapper;
    /**
     * 增加选择题
     * @param multiQuestion
     * @return
     */
    @Override
    public int add(MultiQuestion multiQuestion) {
        return multiQuestionMapper.add(multiQuestion);
    }
    /**
     * 查询最后一条记录的questionId
     * @return
     */
    @Override
    public MultiQuestion findOnlyQuestionId() {
        return multiQuestionMapper.findOnlyQuestionId();
    }

    @Override
    public List<MultiQuestion> findByIdAndType(Integer paperId) {
        return multiQuestionMapper.findByIdAndType( paperId);
    }

    @Override
    public List<Integer> findBySubject(String subject, Integer changeNumber) {
        return multiQuestionMapper.findBySubject(subject,changeNumber);
    }
}
